package com.ruoyi.js.service.impl;

import java.util.List;
import com.ruoyi.framework.util.ShiroUtils;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.framework.util.ShiroUtils;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.js.mapper.JsPlaceMapper;
import com.ruoyi.js.domain.JsPlace;
import com.ruoyi.js.service.IJsPlaceService;
import com.ruoyi.common.core.text.Convert;

/**
 * 场地Service业务层处理
 * 
 * @author greejoy
 * @date 2024-10-16
 */
@Service
public class JsPlaceServiceImpl implements IJsPlaceService 
{
    @Autowired
    private JsPlaceMapper jsPlaceMapper;

    /**
     * 查询场地
     * 
     * @param id 场地ID
     * @return 场地
     */
    @Override
    public JsPlace selectJsPlaceById(Long id)
    {
        return jsPlaceMapper.selectJsPlaceById(id);
    }

    /**
     * 查询场地列表
     * 
     * @param jsPlace 场地
     * @return 场地
     */
    @Override
    public List<JsPlace> selectJsPlaceList(JsPlace jsPlace)
    {
        return jsPlaceMapper.selectJsPlaceList(jsPlace);
    }

    /**
     * 新增场地
     * 
     * @param jsPlace 场地
     * @return 结果
     */
    @Override
    public int insertJsPlace(JsPlace jsPlace)
    {
        jsPlace.setCreateBy(ShiroUtils.getLoginName());
        jsPlace.setCreateTime(DateUtils.getNowDate());
        return jsPlaceMapper.insertJsPlace(jsPlace);
    }

    /**
     * 修改场地
     * 
     * @param jsPlace 场地
     * @return 结果
     */
    @Override
    public int updateJsPlace(JsPlace jsPlace)
    {
        jsPlace.setUpdateBy(ShiroUtils.getLoginName());
        jsPlace.setUpdateTime(DateUtils.getNowDate());
        return jsPlaceMapper.updateJsPlace(jsPlace);
    }

    /**
     * 删除场地对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteJsPlaceByIds(String ids)
    {
        return jsPlaceMapper.deleteJsPlaceByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除场地信息
     * 
     * @param id 场地ID
     * @return 结果
     */
    @Override
    public int deleteJsPlaceById(Long id)
    {
        return jsPlaceMapper.deleteJsPlaceById(id);
    }
}
